﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kopytko.GameBase;

namespace Kopytko.BoardGame
{
    public abstract class BoardLogic : IBoardLogic
    {


        public event EventHandler PlayerChanged;
        public event EventHandler Reload;

        protected void OnReload()
        {
            if (Reload != null)
            {
                Reload(this, new EventArgs());
            }
        }

        public virtual Pawns Pawns { get; protected set; }
        public BoardPlayer Player1 { get; protected set; }
        public BoardPlayer Player2 { get; protected set; }

        public abstract void Init();

        public abstract GameBase.IPlayer WhoTurnIs();

        public abstract IEnumerable<BoardPosition> GetAvailableMovements(BoardPosition currentPosition);


        public abstract bool IsMoveAllowed(BoardPosition currentPosition);

        public abstract MoveResult Move(BoardPosition currentPosition, BoardPosition destPosition);
    }
}
